<?php

namespace App\Admin\Index\Controllers;

use App\Admin\Manage\Models\Admin;
use App\Classlib\FormCheck;
use App\Admin\Models\Permission\Role;
use Illuminate\Http\Request;
use App\Admin\Controller;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Session;

class IndexController extends Controller
{
    public function __construct(){
        $this->formCheck = new FormCheck();
    }

    public function index(){
        return view("Index.Views.index")
                ->with("thisAction",'/')
                ->with("title",Lang('Index','home'));
    }

    public function profile(){
        $role = new Role();
        $roleLists = $role->getRoleLists();
        $adminInfo = Session::get("adminInfo");
        return view("Admin.profile")
            ->with("thisAction","")
            ->with("roleLists",$roleLists)
            ->with("adminInfo",$adminInfo)
            ->with("formAction","editForm")
            ->with("title","基本资料");
    }

    public function bases(){
        return view("Admin.base")
            ->with("thisAction",'/bases');
    }

    public function indexStatistics(Request $request){
        return result("数据获取成功！",1);
    }
}